<?php
//Afmetingen A4 in pixels (web) : 595 x 842
require_once('top.php');
include_once('french.php');
require_once('pasmy/dbwaarden.php');
include_once('funktie.php');
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);

$uitprinten = $_POST["uitprinten"];
$att = addslashes($_POST["att"]);
$transporteur = addslashes($_POST["transporteur"]);
$straat = addslashes($_POST["straat"]);
$zippy = addslashes($_POST["zippy"]);
$telefoon = addslashes($_POST["telefoon"]);
$fax = addslashes($_POST["fax"]);

$firma1 = addslashes($_POST["firma1"]);
$straat1 = addslashes($_POST["straat1"]);
$zippy1 = addslashes($_POST["zippy1"]);
$telefoon1 = addslashes($_POST["telefoon1"]);
$fax1 = addslashes($_POST["fax1"]);

$firma2 = addslashes($_POST["firma2"]);
$straat2 = addslashes($_POST["straat2"]);
$zippy2 = addslashes($_POST["zippy2"]);
$telefoon2 = addslashes($_POST["telefoon2"]);
$fax2 = addslashes($_POST["fax2"]);

$aard = addslashes($_POST["aard"]);
$beschik = addslashes($_POST["beschik"]);
$opm = addslashes($_POST["opm"]);
$prijs = addslashes($_POST["prijs"]);
$poids = addslashes($_POST["poids"]);

if(isset($uitprinten)) {
$sql = "insert into faxen (geadresseerde,transporteur,straat,zippy,telefoon,fax,firma1,straat1,zippy1,telefoon1,fax1,firma2,straat2,zippy2,telefoon2,fax2,aard,beschikbaar,opm,prijs,gewicht)
			VALUES ('$att','$transporteur','$straat','$zippy','$telefoon','$fax','$firma1','$straat1','$zippy1','$telefoon1','$fax1','$firma2','$straat2','$zippy2','$telefoon2','$fax2','$aard','$beschik','$opm','$prijs','$poids')";	
//echo "sql = $sql<br>";
$res = mysql_query($sql, $mysql_id);
fout($mysql_id);

$sql = "select klantnr from faxen";
$res = mysql_query($sql, $mysql_id);
while ($row = mysql_fetch_row($res)) {
	$klantnr = $row[0];
}
if($klantnr < 10) {$klantnr = "00" . $klantnr;}
//if($klantnr < 100) {$klantnr = "0" . $klantnr;}

?>
<table width="640" border="1">
<tr>
<td colspan="2"><div style="text-align: center"><font size="6">Transportopdracht</font></div></td>
</tr>
<tr>
<td colspan="2"><strong>Ter attentie van : <?php echo $att;?></strong></td>
</tr>
<tr>
<td width="320" class="center"><div style="text-align: center">Afzender</div></td>
<td width="320" class="center"><div style="text-align: center">Geadresseerde</div></td>
</tr>
<tr valign="top">
<td>
<h4>
Transport Vanzeveren Transit S.A.<br />
Rue de l'Echauffour&eacute;e<br />
B-7700 Mouscron<br />
Tel : 0032 (0)56.33.49.64<br />
Fax : 0032 (0)56.34.39.19
</h4>
</td>
<td><h4>
<?php 
echo "$transporteur<br />";
echo "$straat<br />";
echo "$zippy<br>";
echo "Tel : $telefoon<br>";
echo "Fax : $fax<br>";
?>
</h4>
</td>
</tr>
<tr>
<td class="center">Laadadres</td>
<td class="center">Losadres</td>
</tr>
<tr valign="top">
<td><h4><?php 
echo "$firma1<br />";
echo "$straat1<br />";
echo "$zippy1<br>";
echo "Tel : $telefoon1<br>";
echo "Fax : $fax1<br>";

?>
 
</h4>
</td>
<td><h4>
<?php 
echo "$firma2<br />";
echo "$straat2<br />";
echo "$zippy2<br>";
echo "Tel : $telefoon2<br>";
echo "Fax : $fax2<br>";

;?>
</h4>
</td>
</tr>
<tr>
<td colspan="2"><strong>Aard van de goederen : <?php echo $aard;?></strong></td>
</tr>
<tr>
<td colspan="2"><strong>Gewicht : <?php echo $poids;?></strong></td>
</tr>
<tr>
<td colspan="2"><strong>Goederen beschikbaar vanaf : <?php echo $beschik;?></strong></td>
</tr>
<tr>
<td colspan="2"><strong>Overeengekomen prijs : <?php echo $prijs;?> &euro;</strong></td>
</tr>
<tr>
<td colspan="2"><strong>Opmerkingen : <?php echo $opm;?></strong></td>
</tr>
<tr>
<td colspan="2">

<p>Bij de minste problemen ons onmiddellijk verwittigen, zoniet kunnen geen extra kosten aanvaard worden</p>
<p>Afgesproken prijs = prijs all-in (inclusief alle toeslagen)</p>
<p>Alle transporten gebeuren onder CMR voorwaarden.</p>
<p>Europaletten dienen geruild te worden of uiterlijk binnen de 10 werkdagen teruggebracht worden naar de laadplaats en ons hiervan op de hoogte brengen
,zoniet wordt een forfait van 16 &euro; per palet aangerekend en in vermindering gebracht van de faktuur.</p>
<p>Klantenbescherming maakt integraal deel uit van deze overeenkomst.</p>

</td>
</tr>
<tr valign="top">
<td colspan="2">
<strong>
Terryn Serge<br />
GSM : 0032 (0) 495.28.25.70<br />
E-mail : serge.terryn@roussel-international.com<br />
</strong>
</td>
 
</tr>
<tr>
<td class="fax"><strong>
France :<br />
Tel : 0033 (0)3.20.62.19.92<br />
Fax : 0033 (0)3.20.62.19.51<br />

</strong></td>

<td>
<strong>
BNP Paribas Fortis<br />
IBAN BE23 2850 3204 5391<br />
BIC GEBABEBB<br />
</strong>
</td>
</tr>
<tr>
<td colspan="2"><strong>Referentie te vermelden op faktuur : 
<?php 
$jaar = date("Y");
$maand = date("m");
$datum = $jaar . "/" . $maand . "/";
echo $datum . $klantnr;?></strong></td>
</tr>
</table>

</body>

<?php
}
else {
?>
<form action="opdracht.php" method="post">
<table align="center" border="1" class="fax">
<tr><td colspan="2" class="center">Transporteur</td><td colspan="2" rowspan="7">&nbsp;</td></tr>
<tr>
<td class="fax"><strong>Ter attentie van : </strong></td><td><input type="text" name="att" size="25" maxlength="80" /></td>
</tr>
<tr><td class="fax"><strong>Transportfirma :</strong></td><td><input type="text" name="transporteur" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Straat en nr :</strong></td><td><input type="text" name="straat" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Postnummer en plaats : </strong></td><td><input type="text" name="zippy" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Tel : </strong></td><td><input type="text" name="telefoon" size="25" maxlength="80" /></td></tr>
<td class="fax"><strong>Fax : </strong></td><td><input type="text" name="fax" size="25" maxlength="80" /></td></tr>

<tr><td colspan="2" class="center">Laadadres</td><td colspan="2" class="center">Losdadres</td></tr>

<tr><td class="fax"><strong>Firma :</strong></td><td><input type="text" name="firma1" size="25" maxlength="80" /></td><td class="fax"><strong>Firma :</strong></td><td><input type="text" name="firma2" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Straat en nr :</strong></td><td><input type="text" name="straat1" size="25" maxlength="80" /></td><td class="fax"><strong>Straat en nr :</strong></td><td><input type="text" name="straat2" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Postnummer en plaats : </strong></td><td><input type="text" name="zippy1" size="25" maxlength="80" /></td><td class="fax"><strong>Postnummer en plaats : </strong></td><td><input type="text" name="zippy2" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Tel : </strong></td><td><input type="text" name="telefoon1" size="25" maxlength="80" /></td><td class="fax"><strong>Tel : </strong></td><td><input type="text" name="telefoon2" size="25" maxlength="80" /></td></tr>
<td class="fax"><strong>Fax : </strong></td><td><input type="text" name="fax1" size="25" maxlength="80" /></td><td class="fax"><strong>Fax : </strong></td><td><input type="text" name="fax2" size="25" maxlength="80" /></td></tr>
<tr><td colspan="2">&nbsp;</td><td colspan="2" rowspan="6">&nbsp;</td></tr>
<tr><td class="fax"><strong>Aard goederen :</strong></td><td><input type="text" name="aard" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Gewicht :</strong></td><td><input type="text" name="poids" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Goederen beschikbaar vanaf :</strong></td><td><input type="text" name="beschik" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Overeengekomen prijs :</strong></td><td><input type="text" name="prijs" size="25" maxlength="80" /></td></tr>
<tr><td class="fax"><strong>Opmerkingen</strong></td><td><input type="text" name="opm" size="25" maxlength="80" /></td></tr>

<tr><td colspan="4" class="fax"><br /><div style="text-align: center"><input type="submit" name="uitprinten" value="Uitprinten" /></div><br /></td></tr>
</table>



</form>
<?php
}
//printer_close($handle);
?>